\fc0 Q: How do you make an application hide when it's auto-launched from the dock?\
\
Q: I'm having trouble getting my application to hide when auto-launched. What's the correct way to make it happen?\
\
A: When your application launches, it should check the
\f1\fs24 NXAutoLaunch
\f0\fs28 default. A “NO” value means the application wasn't auto-launched from the Dock, and a “YES” value means it was. The application should check this value before creating or displaying any user interface. It should complete its initialization when the user activates it for the first time (the code for detecting and handling this condition should reside within the
\f1\fs24 appDidUnhide:
\f0\fs28 delegate method).\
\
Another approach might be to completely initialize the application and then check the default. If the auto-launch condition were true, it could send itself the
\f1\fs24 hide:
\f0\fs28 message and disappear. The first problem with this approach is that it leads to flashing windows, meaning that if (for example) your application creates a default document or displays a palette when it starts up, the window or palette will appear onscreen, and then quickly disappear when the application hides itself. The second problem is that some timing snarls in the AppKit currently prevent this (sending the